function [maxdif,pos]=comparemat(x,y,flagSilent)
% function [maxdif,pos]=comparemat(x,y);
% Find the maxium difference between x and y 
% Display onscreen and also report position indicator 
% as [row col]
% Alejandro Justiniano (C) April 5 2007
if nargin < 3 || flagSilent~=1 
    flagSilent=0; 
end 
if ~isequal(size(x),size(y)); error('Mismatch X and Y dimension'); end; 
[maxdif,rind]=max( abs(x-y) );[maxdif,cind]=max(maxdif);
pos=[rind(cind) cind]; 
if flagSilent~=1 
disp(sprintf('Maximum difference is %2.5e',maxdif));
end 